//
//  BiCarModifyParser.m
//  TrunkIndustryManageSystem
//
//  Created by WT_lyy on 15/5/5.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//

#import "BiCarModifyParser.h"
#import "BiCarModifyEntity.h"
#import "JSONKit.h"
#import "MJExtension.h"
@implementation BiCarModifyParser
SINGLE_INSTANCE_IMPLEMENTION(BiCarModifyParser)

//获取变更列表
+ (NSDictionary *)parserCarModifyListEntity:(NSString*)jsonStr{
    
    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    NSMutableArray * dataArr = [NSMutableArray array];
    
    id  data = jsonDic[@"data"];
    
    if ([data isKindOfClass:[NSArray class]]) {
        
        NSArray * Array = (NSArray *)data;
        
        for (NSDictionary * dict in Array ) {
            
            NSDictionary * dic = dict[@"carCertificateInfo"];
            
            BiCarModifyEntity * entity = [BiCarModifyEntity objectWithKeyValues:dic];
            
            entity.e_id = dic[@"id"];
            
            [dataArr addObject:entity];
            
        }
    }
    
    return [NSDictionary dictionaryWithObjectsAndKeys:jsonDic[@"response_status"],@"response_status",jsonDic[@"result_info"],@"result_info",dataArr,@"data", nil];
}

+ (NSDictionary *)parserCarModifyCommon:(NSString*)jsonStr{

    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:jsonDic];
    
    return dict;
}


@end
